<template>
  <div class="collection">
    <van-checkbox-group v-model="result" ref="ad">
      <van-swipe-cell
        v-for="(item, index) in $store.state.collist"
        :key="index"
      >
        <van-card
          :num="item.num"
          :price="item.product_price"
          :title="item.product_name"
          :thumb="item.product_picture"
          :desc="item.product_intro"
        >
          <template #footer>
            <button @click="out(item)">删除</button>
            <van-icon name="shopping-cart-o" size="30" @click="add(item)" />
          </template>
        </van-card>
      </van-swipe-cell>
    </van-checkbox-group>
  </div>
</template>

<script>
export default {
  data() {
    return {
      result: [],
    };
  },
  mounted() {},
  methods: {
    out(val) {
      this.$store.commit("out", val);
    },
    change() {
      this.$store.commit("change");
    },
    add(val) {
      this.$store.commit("add", val);
    },
  },
};
</script>

<style lang="scss"></style>
